<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-09-01 16:15:05
 * @LastEditors: voanit
 * @LastEditTime: 2022-09-01 17:43:24
-->
<script setup>
import { ref } from 'vue'
import useStore from '../store'
const { todo } = useStore()
const name = ref('')

const add = () => {
  todo.Aadd(name.value)
  name.value = ''
}
</script>



<template>
  <header class="header">
    <h1>todos</h1>
    <input @keyup.enter="add" v-model="name" class="new-todo" placeholder="What needs to be done?" autofocus />
  </header>
</template>

<style lang="less" scoped>
</style>
